package cn.muqingfeng.api.to;

import com.google.gson.annotations.SerializedName;

import android.os.Parcel;
import android.os.Parcelable;

public class BaseResponseTO implements Parcelable {
	@SerializedName("result")
	private boolean success;

	@SerializedName("msg")
	private String message;

	public BaseResponseTO() {
	}

	public BaseResponseTO(Parcel source) {
		this.success = source.readInt() == 1;
		this.message = source.readString();
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(success ? 1 : 0);
		dest.writeString(message);
	}

	public static final Creator<BaseResponseTO> CREATOR = new Creator<BaseResponseTO>() {

		@Override
		public BaseResponseTO[] newArray(int size) {
			return new BaseResponseTO[size];
		}

		@Override
		public BaseResponseTO createFromParcel(Parcel source) {
			return new BaseResponseTO(source);
		}
	};

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
